package Pages;

import appium1.common.Helper;
import org.openqa.selenium.WebElement;

public class Pagemysetings {
    private Helper helper;

    public Pagemysetings(Helper helper) {
        this.helper = helper;
    }

    /**
     * 控件的定位
     * @return
     */
    public WebElement getSettingsBtn() {
        return helper.findById("net.oschina.app:id/iv_logo_setting");
    }

    public WebElement getLoginIcon() {
        return helper.findById("net.oschina.app:id/iv_portrait");
    }

    public WebElement getMyMsg() {
        return helper.findById("net.oschina.app:id/rl_message");
    }
    public WebElement getMyblogItem(){
        return  helper.findById("net.oschina.app:id/rl_blog");
    }
    public WebElement getMyActivities(){
        return helper.findById("net.oschina.app:id/rl_info_activities");
    }
    public WebElement getMyTeamiem(){
        return  helper.findById("net.oschina.app:id/rl_team");
    }
    public WebElement getNickNameTextView(){
        return helper.findById("net.oschina.app:id/tv_nick");
    }

    public WebElement getFavoritesLayout(){
        return helper.findById("net.oschina.app:id/ly_favorite");
    }

    /**
     * 控件的操作
     */
    public void  clickSettingBtn(){
        helper.click(getSettingsBtn());
    }
    public  void clickMyMsg(){
        helper.click(getMyMsg());
    }
    public void clickMyActivities(){
        helper.click(getMyActivities());
    }
    public void clickMyItem(){
        helper.click(getMyTeamiem());
    }
    public void clickBlog(){
        helper.click(getMyblogItem());
    }
    public void clickFavorit(){
        helper.click(getFavoritesLayout());
    }
    public String getNickName(){
        return helper.getText(getNickNameTextView());
    }
    public void clickLoginIcon(){
        helper.click(getLoginIcon());
    }
}